import Router from 'koa-router';
import proxyService from '../../common/proxyService';
import {
  getNoticeMessageList,
  deleteNoticeMessage,
  getNoticeMessageInfo,
  saveNoticeMessageInfo,
  getNewsUpdateGetCmsCloudToken,
} from '../../api/manage_notice';
const router = new Router();

//
router.post('/getNoticeMessageList', async ctx => {
  const response = await proxyService.postProxy(ctx, getNoticeMessageList);
  return (ctx.body = response);
});

//
router.post('/deleteNoticeMessage', async ctx => {
  const response = await proxyService.postProxy(ctx, deleteNoticeMessage);

  return (ctx.body = response);
});

//
router.post('/getNoticeMessageInfo', async ctx => {
  const response = await proxyService.postProxy(ctx, getNoticeMessageInfo);
  return (ctx.body = response);
});

//
router.post('/saveNoticeMessageInfo', async ctx => {
  const response = await proxyService.postProxy(ctx, saveNoticeMessageInfo);
  return (ctx.body = response);
});

router.post('/getNewsUpdateGetCmsCloudToken', async ctx => {
  const response = await proxyService.postProxy(ctx, getNewsUpdateGetCmsCloudToken);
  return (ctx.body = response);
});
export default router;
